package cn.wanho.mapper;

import cn.wanho.dto.ExamClass;
import cn.wanho.rvo.ClassRVO;
import cn.wanho.rvo.StudentRVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ExamClassMapper {


    /**
     * 创建班级
     * @param className
     * @return
     */
    int createClass(String className);

    /**
     * 创建阶段
     * @param stageName
     * @return
     */
    int createStage(String stageName);

    /**
     * 查看所有学生的考试情况
     */
    List<StudentRVO> queryAllStudentScore(@Param("className") String className,
                                          @Param("teacherName") String teacherName,
                                          @Param("studentName") String studentName,
                                          @Param("stageName") String stageName);



    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(ExamClass record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(ExamClass record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    ExamClass selectByPrimaryKey(Long id);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(ExamClass record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(ExamClass record);

    List<ClassRVO> selectClass(int userId);

}